﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication2.Controllers
{
    public class NewsController : Controller
    {        

        /// <summary>
        /// 获取一新闻列表
        /// </summary>
        /// <returns></returns>
        public ActionResult NewsList()
        {
            List<Models.NewsModels> newsList = new List<Models.NewsModels>();

            for (int i = 0; i < 10; i++)
            {

                Models.NewsModels news = new Models.NewsModels();

                news.Id = i;

                news.Title = "Title" + i.ToString();

                news.CreateTime = System.DateTime.Now;

                news.Content = "Content 新?闻?内¨²容¨Y" + i.ToString();

                newsList.Add(news);
            }
            ViewData["newslist"] = newsList;

            return View();            
        }

        /// <summary>
        /// 修改新闻
        /// </summary>
        /// <returns></returns>
        public ActionResult NewsEdit()
        {
            return View();     
        }

        
    }
}
